<!--
 * @Author: jack-ZM
 * @Date: 2022-08-03 09:40:54
 * @LastEditors: jack-ZM
 * @LastEditTime: 2022-09-01 17:39:12
 * @FilePath: /vue3ts-admin-template/src/views/user-manager/redirect/index.vue
 * @Description: 重定向路由拦截中转
 * 
 * Copyright (c) 2022 by zsm smzhang@fiberhome.com, All Rights Reserved. 
-->
<script lang="ts">
import { defineComponent } from 'vue';
import { useRoute, useRouter } from 'vue-router';

export default defineComponent({
    setup() {
        const { params, query } = useRoute();
        const { path } = params;
        useRouter()
            .replace({ path: '/' + path, query })
            .catch((err) => {
                console.warn(err);
            });
    },

    // eslint-disable-next-line vue/require-render-return
    render() {
        // Avoid warning for missing template
    }
});
</script>
